package a_o2odata_deal.utils.zhibo_qy

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.SQLContext

/**
  * @ Auther: o2o-rd-0008
  * @ Date:   2020/2/11 15:40
  * @ Param:  ${PARAM}
  * @ Description: 
  */
object zhibo_qy_main {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setAppName(s"${this.getClass.getSimpleName}")
    conf.set("spark.debug.maxToStringFields", "500")
    //conf.setMaster("local[*]")
    conf.set("es.nodes", "192.168.1.157")
    conf.set("es.port", "9200")
    conf.set("cluster.name", "O2OElastic")
    conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
    conf.set("spark.sql.caseSensitive", "true")
    val sc = new SparkContext(conf)
    val sqlContext = new SQLContext(sc)
    sc.setLogLevel("WARN")
    sc.hadoopConfiguration.set("fs.s3a.access.key", "GAO7EO9FWKPJ8WFCQDME")
    sc.hadoopConfiguration.set("fs.s3a.secret.key", "LZ0xaHBSYKHaJ9ECDbX9f7zin79UZkXfGoNapRPL")
    //sc.hadoopConfiguration.set("fs.s3a.endpoint", "https://obs.cn-north-1.myhuaweicloud.com")

    //处理数据本身的直播
    a_o2odata_deal.utils.zhibo_qy.handle_zhibo_good.handle_qiye_good(sqlContext)
    //更新all useid库
    a_o2odata_deal.utils.zhibo_qy.update_all_userid.update_all_userid(sqlContext)
   ////处理liveid+goodid集合
    a_o2odata_deal.utils.zhibo_qy.handle_zhibo_live_good.handle_live_good(sqlContext)
    ////处理天猫平台各个的主播表
    a_o2odata_deal.utils.zhibo_qy.handle_zhibo_live_zhubo.handle_zhibo_live_zhubo(sqlContext)
    //所有主播表
    a_o2odata_deal.utils.zhibo_qy.handle_all_anchor.handle_all_anchor(sqlContext)
    //计算主播店铺表
    a_o2odata_deal.utils.zhibo_qy.handle_anchor_shop.handleAnchorShop(sqlContext)


  }

}
